﻿namespace AspDotNet.Core7.First.Middlewares
{
    public partial class ContentMiddleware
    {
        public class RequestEditingMiddleware : BaseMiddleware
        {
            public RequestEditingMiddleware(RequestDelegate nextMiddleware)
                : base(nextMiddleware)
            {
            }

            public async Task Invoke(HttpContext httpContext)
            {
                httpContext.Items["Firefox"] = httpContext.Request.Headers["User-Agent"].Any(v => v.Contains("Firefox"));
                await NextMiddleware.Invoke(httpContext);
            }
        }
    }
}
